<?php
require_once('../libraryfiles/config.php');
//require_once S_ROOT . '/libraryfiles/cart-functions.php';
$orderfrom = $_GET['id'];  //get od_id value from url from page order
$proId = $_GET['product_id'];

$sel_ord = mysql_query("SELECT phar.pharmacy_name, phar.address, phar.phone, phar.email, porder.od_date, pro.product_name, pip.price, porderi.od_qty, img.id, img.thumbnail, pro.id AS productId                      
                        FROM tbl_order_item AS porderi
                        INNER JOIN tbl_order AS porder ON porderi.od_id = porder.od_id
                        INNER JOIN tblproduct_in_pharmacy AS pip ON pip.pid = porderi.pd_id
                        INNER JOIN tblproduct AS pro ON pro.id = pip.product_id
                        INNER JOIN tblimage AS img ON pro.id = img.product_id
                        INNER JOIN tblpharmacy AS phar ON phar.user_id = pro.owner
                        INNER JOIN tbluser AS u ON u.id = porder.user_id
                        WHERE porderi.od_id ='" . $orderfrom . "'
                        AND pip.product_id ='" . $proId . "'
                        ORDER BY porder.od_id ASC");

$content = 'product_shopping.php';
require_once TMP_USER_PATH;
?> 

<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
<style>
    .toggler
    {
        margin: 10px 0 0 0;
    }
    .button {		
        text-decoration: none;        
    }
    .point
    {
        cursor: pointer;
    }
    #effect {
        position: relative;
        padding: 0.4em;
    }
    h3.statistic {
        margin: 0;
        padding: 0.4em;
        text-align: left;
        font-size: 14px;
        display:block;
    }
    .t_none
    {
        border:none;
    }
</style>
<div class="row">
    <div class="nine columns">
        <div style="margin: 10px 15px 0 0;padding-bottom: 30px;">
            <h3 class="statistic ui-widget-header ui-corner-all"><!--Order--><?php echo 'product order' ?></h3>



            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

                <tr>
                    <th><strong>ID</strong></th>
                    <th><strong>Images</strong></th>
                    <th><strong>Product name</strong></th>
                    <th><strong>Quantity</strong></th>
                    <th><strong>Price</strong></th>
                    <th><strong>Total</strong></th>
                </tr>
                <?php
                while ($rows = mysql_fetch_assoc($sel_ord)) {
                    ?>         

                    <tr>
                        <td width="1%" align="center"><?php echo $rows['id']; ?></td>
                        <td width="2%" align="center"><img height="50" width="50" style="float: left;" class="img-active" src="<?php echo W_S_IMAGES_DIR . $rows['thumbnail']; ?>" /></td>
                        <td width="2%" align="center"><a href="<?php echo W_ROOT;?>/product/product_detail.php?product_id=<?php echo $rows['productId']?>" target="_blank" title="<?php echo $rows['product_name']; ?>"><?php echo $rows['product_name']; ?></a></td>
                        <td width="1%" align="center"><?php echo $rows['od_qty']; ?></td>
                        <td width="1%" align="center"><?php echo $rows['price']; ?> $</td>
                        <td width="1%" align="center"><?php echo $rows['od_qty'] * $rows['price']; ?>&nbsp;$</td>
                    </tr>

                    <tr style="background-color: #dcdcdc"><td colspan="6"></td></tr>
                </table>

                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

                    <tr>
                        <td><strong>Order Date:</strong></td>
                        <td><?php echo $rows['od_date']; ?></td>
                    </tr>            
                    <tr>
                        <td><strong>Shop Name:</strong></td>
                        <td><?php echo $rows['pharmacy_name']; ?></td>
                    </tr>            
                    <tr>
                        <td><strong>Shop Phone:</strong></td>
                        <td><?php echo $rows['phone']; ?></td>
                    </tr>
                    <tr>
                        <td><strong>Shop Address:</strong></td>
                        <td><?php echo $rows['address']; ?></td>
                    </tr>           
                    <tr>
                        <td><strong>Shop Email:</strong></td>
                        <td><?php echo $rows['email']; ?></td>
                    </tr>
                    <tr style="background-color: #dcdcdc"><td colspan="6"></td></tr>

                </table>

                <?php
            } //.................End while.....................
            ?>

        </div>
    </div>
</div>


